//
//  ZegoLiveHostThreeListView.swift
//  GLUZ
//
//  Created by lemon on 2025/3/8.
//

import UIKit

class ZegoLiveHostThreeListView: UIView {
    
    var host: ZegoUIKitUser? {
        didSet {
            guard let host = host else {
                return
            }
            self.setHeadUserName(host.userName ?? "")
        }
    }
    lazy var firstButton: UIButton = {
        let button = UIButton()
        button.addTarget(self, action: #selector(firstButtonClick), for: .touchUpInside)
        button.setImage(UIImage(named: "icon_result_success"), for: .normal)
        return button
    }()
    lazy var secondButton: UIButton = {
        let button = UIButton()
        button.addTarget(self, action: #selector(secondButtonClick), for: .touchUpInside)
        button.setImage(UIImage(named: "icon_result_success"), for: .normal)
        return button
    }()
    lazy var thirdButton: UIButton = {
        let button = UIButton()
        button.addTarget(self, action: #selector(thirdButtonClick), for: .touchUpInside)
        button.setImage(UIImage(named: "icon_result_success"), for: .normal)
        return button
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.clear
        self.addSubview(self.thirdButton)
        self.addSubview(self.secondButton)
        self.addSubview(self.firstButton)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.setupLayout()
    }
    
    func setupLayout() {
        self.thirdButton.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
        self.secondButton.frame = CGRect(x: 35, y: 0, width: 30, height: 30)
        self.firstButton.frame = CGRect(x: 70, y: 0, width: 30, height: 30)
    }
    
    private func setHeadUserName(_ userName: String) {
//        if userName.count > 0 {
//            let firstStr: String = String(userName[userName.startIndex])
//        }
    }
    
    @objc func firstButtonClick() {

        
    }
    
    @objc func secondButtonClick() {

        
    }
    
    @objc func thirdButtonClick() {

        
    }
}

